home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earcd / giochi / adoom / amiga_notes.txt < prev    next >
Text File  |  1998-02-20  |  32KB  |  670 lines

  1. ========================================================================
  2. v1.1 20 Feb 98
  3. ------------------------------------------------------------------------
  4. Restored MAXVISSPRITES, MAXDRAWSEGS and MAXVISPLANES to their original
  5. values.  They took up too much memory and often caused structures to be
  6. allocated in chipmem, slowing the game down.
  7.  
  8. ------------------------------------------------------------------------
  9. Explicitly declare KeymapBase in amiga_video.c and explicitly open and
  10. close keymap.library.  Otherwise SAS/C tries to open v38 of
  11. keymap.library (because __oslibversion == 38 in amiga_main.c) and this
  12. fails in OS3.0 which comes with only v37 of keymap.library.
  13.  
  14. ------------------------------------------------------------------------
  15. Increased MAXSPECIALCROSS in p_enemy.c from 8 to 20 to match p_map.c.
  16. (With the original value of 8, array indices go out of bounds in
  17. p_map.c.)
  18.  
  19. ========================================================================
  20. v1.0 19 Feb 98
  21. ------------------------------------------------------------------------
  22. Changed amiga_video.c to pre-calculate amiga colourtables for all
  23. possible palettes for a given gamma level.  Added new routine
  24. I_RecalcPalettes().  Added another argument to I_SetPalette().  Change
  25. all places where I_SetPalette() is called and also where usegamma is
  26. modified.  Fixed bug with colour 0.
  27.  
  28. ------------------------------------------------------------------------
  29. Added support for different display resolutions.  Added -width and
  30. -height options in v_video.c.  SCREENWIDTH and SCREENHEIGHT are now
  31. variables.  All static arrays with size dependent on SCREENWIDTH and
  32. SCREENHEIGHT are now dynamically allocated.  In particular,
  33. openings[], floorclip[], ceilingclip[], spanstart[], spanstop[],
  34. yslope[], distscale[], cachedheight[], cacheddistance[],
  35. cachedxstep[], cachedystep[], xtoviewangle[], negonearray[],
  36. screenheightarray[], ylookup[], ylookup2[], columnofs[] and
  37. FUZZOFFSET[] are now pointers instead of arrays.  Dynamically
  38. initialise FUZZOFFSET[] table.  Also the top[] and bottom[] arrays in
  39. visplane_t are now pointers to shorts instead of arrays of bytes.  Row
  40. index no longer fits in a byte.  Changed many lea instructions in
  41. amiga_draw.s to movea.l instructions to handle pointers instead of
  42. arrays.
  43.  
  44. Many occurrances of SCREENWIDTH and SCREENHEIGHT changed to 320 and
  45. 200 respectively because they refer to, e.g, fixed data read from
  46. file.  On the other hand, many constants changed to formulas involving
  47. SCREENWIDTH and SCREENHEIGHT because they deal with display offsets.
  48.  
  49. Added V_DrawPatchInDirect() and V_DrawPatchInDirectFlipped() functions
  50. to v_video.c which stretch a patch while rendering to display.  Used
  51. these for stretching init/help/finale screens and for stretching icons
  52. and text.
  53.  
  54. Modified R_DrawViewBorder() in r_draw.c to draw border around sides of
  55. status bar.
  56.  
  57. Many of the ideas and code snippets for high resolution modes came
  58. from v0.47 of DOSDOOM, a DOS port of LinuxDOOM by Chi Hoang
  59. (cyhoang@acs.ucalgary.ca).
  60.  
  61. Modified C2P routines to handle large displays.  Chip buffers are now
  62. dynamically allocated in amiga_video.c.  Very long blits are split
  63. into smaller blits that the blitter can cope with.
  64.  
  65. Changed the vertical scale for rendering the sky so it doesn't "wrap
  66. around" in high resolution modes.  New variable: pspriteiscale2.
  67.  
  68. ------------------------------------------------------------------------
  69. Added dehacked.c from Cyril Deble <Cyril.Deble@inforoute.cgs.fr> for
  70. parsing .DEH format patch files.  Called from d_main.c.
  71.  
  72. ------------------------------------------------------------------------
  73. Rewrote keyboard handling routine.  Now call keymap.library
  74. MapRawKey() for raw keycodes < 0x40.  Translate numeric keypad keys to
  75. different codes.
  76.  
  77. ------------------------------------------------------------------------
  78. Call cybergraphics.library BestCModeIDTags() to find best mode (if
  79. cybergraphics.library was successfully opened).
  80.  
  81. ------------------------------------------------------------------------
  82. Added I_MarkRect() to amiga_video.c to record dirtybox.  Every
  83. rendering function that used to call V_MarkRect() now calls
  84. I_MarkRect() to record the rectangle that was dirtied.  The main 3D
  85. viewwindow is the only thing not so marked.  I_FinishUpdate() uses
  86. this information to minimise the amount of copying with WPA8() or
  87. C2P().  (Unfortunately most C2P routines still convert the entire
  88. display because they don't handle offset and modulo.)
  89.  
  90. ------------------------------------------------------------------------
  91. Had another go at getting -directcgx working properly with
  92. double-buffering.  Double-buffering uses a double-height Screen and
  93. ScrollVPort(), not ChangeScreenBuffer().  Not everyone has the latest
  94. version of CyberGraphX which supports ChangeScreenBuffer() yet.
  95.  
  96. The main problem I had before is that I forgot to recalculate the
  97. ylookup[] and ylookup2[] arrays of screen addresses whenever the
  98. buffer flipped.  So ADoom always rendered the 3D view into the same
  99. buffer.
  100.  
  101. At the end of each frame with -directcgx, the dirtybox is copied to
  102. the other buffer with ClipBlit().  That's because text, icons, status
  103. bar, etc, must be rendered into both buffers.  The 3D viewwindow is
  104. not copied unless it falls within the dirtybox.  Hopefully ClipBlit()
  105. uses the gfx-card's blitter because both the src and dest are in the
  106. CyberGraphX Window.
  107.  
  108. I'm still stymied at being unable to read displayed information back
  109. from a CyberGraphX Window, as is done by the wipe routine at the start
  110. of each level (I_ReadScreen()).  ReadPixelArray8() from the hidden
  111. part of a CyberGraphX Window seems to return junk.  Is this a bug in
  112. cybergraphics.library?  LockBitMapTags() followed by memcpy() from the
  113. framebuffer also seems to return junk.  Is the GVP Spectrum 28/24
  114. framebuffer write-only?
  115.  
  116. ------------------------------------------------------------------------
  117. Added several hand-optimised assembly replacements for various C
  118. routines to amiga_draw.s as emailed to me by Arto Huusko
  119. <arto.huusko@pp.qnet.fi>.  This resulted in a significant overrall
  120. speed improvement.  Modified his routines for variable display
  121. resolution.
  122.  
  123. ------------------------------------------------------------------------
  124. Increased some constants to allow much more complex WADs to be
  125. handled, e.g, MAXVISSPRITES: 128->1024, MAXDRAWSEGS: 256->1024,
  126. MAXVISPLANES: 128->1024.  Hopefully that didn't increase memory
  127. requirements too much.
  128.  
  129. ========================================================================
  130. v0.9  7 Feb 98
  131. ------------------------------------------------------------------------
  132. Patched wi_stuff.c and st_lib.c to work if WIMINUS and STTMINUS lumps
  133. are missing from WAD file.  Those lumps are missing from some early
  134. registered doom wads.
  135.  
  136. ------------------------------------------------------------------------
  137. Added -rtg, -native and -ehb options in amiga_video.c in case
  138. autodetection fails.
  139.  
  140. ------------------------------------------------------------------------
  141. Increased priority of double-buffering subtask in amiga_video.c from 5
  142. to 100.
  143.  
  144. ------------------------------------------------------------------------
  145. Added call to chkabort() in P_LookForPlayers() in p_enemy.c so it's
  146. possible to break out of loop when try to play incompatible demo in
  147. registered doom.wad v1.10 with -forcedemo.
  148.  
  149. ------------------------------------------------------------------------
  150. Added code for raw network protocol over NULL-modem serial cable in
  151. amiga_net.c
  152.  
  153. ------------------------------------------------------------------------
  154. Made some optimisations to amiga_fixed.s as suggested by Gerald
  155. Schnabel <Gerri@studbox.uni-stuttgart.de>.
  156.  
  157. ------------------------------------------------------------------------
  158. Applied patches to am_map.c supplied by Cyril Deble to fix bugs with
  159. -rotatemap and -maponhu.
  160.  
  161. ------------------------------------------------------------------------
  162. Changed LONG() and SHORT() macros to SWAPLONG() and SWAPSHORT()
  163. respectively throughout all *.c and m_swap.h files to avoid conflict
  164. with Amiga includes.
  165.  
  166. ------------------------------------------------------------------------
  167. Added -cpu <cpu>, -rtg, -native and -ehb options and corresponding
  168. tooltypes for overriding default autodetection.
  169.  
  170. ------------------------------------------------------------------------
  171. W_AddFile() and W_Reload() in w_wad.c were free()ing memory using a
  172. fileinfo pointer that had been incremented after the fileinfo was
  173. malloc()ed.  Thanks to Frank Wille and Joe Fenton for spotting this.
  174. Fixed.  Also applied patches to amiga_median.c and amiga_video.c
  175. supplied by Frank Wille.
  176.  
  177. ------------------------------------------------------------------------
  178. Moved FPS counter from top-left corner of display to top right in
  179. amiga_video.s.
  180.  
  181. ------------------------------------------------------------------------
  182. Added SEGA controller code from Joe Fenton.  Changes to amiga_video.c
  183. and amiga_main.c.  New file amiga_sega.s.
  184.  
  185. ------------------------------------------------------------------------
  186. Renamed mmu.* to amiga_mmu.*.  Include amiga_mmu.i in source
  187. distribution.  (Was accidently left out before.)  Renamed macros.h to
  188. amiga_macros.h.
  189.  
  190. ------------------------------------------------------------------------
  191. Applied patches to I_SetPalette() in amiga_video.c as supplied by
  192. Jeroen T. Vermeulen <jtv@xs4all.nl>.
  193.  
  194. ------------------------------------------------------------------------
  195. Added ylookup2[] table to d_draw.c and used it to speed up column and
  196. span rendering routines in amiga_draw.s slightly.  Thanks to Danny
  197. Robinson <dannyr@pangea.ca> for suggesting this.
  198.  
  199. ------------------------------------------------------------------------
  200. Added IPX protocol support to amiga_net.c to use G.J. Peltenburg's
  201. amipx.library.  Made changes to d_net.c for calculating PC-compatible
  202. packet checksums.  Added -forceversion and -pcchecksum options.
  203.  
  204. ========================================================================
  205. v0.8 22 Jan 98
  206. ------------------------------------------------------------------------
  207. Changed amiga_video.c to use timer.device and ReadEClock() for timing
  208. instead of SAS/C timer() function.  Resorted to floating-point
  209. arithmetic for converting eclocks to microseconds at the end, so now
  210. compile with MATH=IEEE.
  211.  
  212. ------------------------------------------------------------------------
  213. Lowered volume of music in amiga_music.s, got rid of clicks.  Also
  214. lowered volume of sound effects in amiga_sound.c.  Only the lower half
  215. of the volume control was being used before.
  216.  
  217. ------------------------------------------------------------------------
  218. Now compile with OPTSCHEDULE sc option.
  219.  
  220. ------------------------------------------------------------------------
  221. Added code to amiga_video.c for -fps option for displaying frames per
  222. second in top-left corner.
  223.  
  224. ------------------------------------------------------------------------
  225. For 68040/68060 + AGA, now use comparison buffer C2P routine if window
  226. is smaller than SCREENSIZE-64, else use non-comparison buffer C2P.
  227.  
  228. ------------------------------------------------------------------------
  229. Disabled "S_StartSoundAtVolume: 16bit and not pre-cached - wtf?" msg
  230. in s_sound.c with -nosfx.
  231.  
  232. ------------------------------------------------------------------------
  233. Added -heapsize option in amiga_system.c for specifying zone size in
  234. kilobytes.
  235.  
  236. ------------------------------------------------------------------------
  237. Rewrote R_RenderSegLoop() (in r_segs.c) in assembly language (to
  238. amiga_draw.s) and hand-optimised it a bit.
  239.  
  240. ------------------------------------------------------------------------
  241. Fixed (harmless) missing #endif in d_main.c.
  242.  
  243. ------------------------------------------------------------------------
  244. There appears to be a bug in r_things.c.  The code:
  245.  
  246.     check = namelist;
  247.     while (*check != NULL)
  248.     check++;
  249.  
  250. scans for a NULL which doesn't exist on the end of the namelist array
  251. (unless you're lucky --- it's just whatever comes after the array in
  252. memory).  Fixed by making the sprnames[] array 1 element longer in
  253. info.c and info.h and initialising the last element to NULL.  I wonder
  254. if this fixed the "PNAMES not found" bug.
  255.  
  256. ------------------------------------------------------------------------
  257. Compiled everything with DATA=NEAR.  This involved finding the dozen
  258. or so largest data structures throughout all files and declaring them
  259. with FAR, so the remainder fitted within 64kb.  Added the following
  260. lines to doomdef.h:
  261.  
  262.     #ifdef __SASC
  263.     #define FAR __far
  264.     #else
  265.     #define FAR
  266.     #endif
  267.  
  268. Added #include "doomdef.h" to several files to get the FAR definition.
  269.  
  270. ------------------------------------------------------------------------
  271. Applied patch supplied by Aki to DrawColumn_060() in amiga_draw.s to
  272. fix problem with red stairs and random pixels on 68060.
  273.  
  274. ------------------------------------------------------------------------
  275. Changed most routines in amiga_draw.s to use near A4-relative
  276. addressing of variables.  Couldn't figure out how to do this with
  277. Macro68 (because DT base for A4 is external) so used SAS/C asm
  278. instead.  Had to convert back to old syntax and manually optimise
  279. branches.
  280.  
  281. ------------------------------------------------------------------------
  282. Applied patches supplied by Cyril Deble to d_main.c and am_map.c for
  283. new -rotatemap and -maponhu options.
  284.  
  285. ========================================================================
  286. v0.7 16 Jan 98
  287. ------------------------------------------------------------------------
  288. Version 0.6 had a serious bug in c2p8_040_amlaukka.s which caused
  289. crashes on 68040+AGA and 68060+AGA machines.  Fixed with patch
  290. supplied by Aki Laukkanen.
  291.  
  292. ------------------------------------------------------------------------
  293. Version 0.6 had a serious bug in the use_mmu cleanup code which caused
  294. crashes one exit when -mmu or MMU was used.  Fixed with patch supplied
  295. by Aki Laukkanen.
  296.  
  297. ------------------------------------------------------------------------
  298. Commenting out the Macro68 debug statements in the *.s files made the
  299. executable much smaller.
  300.  
  301. ------------------------------------------------------------------------
  302. The TURBO tooltype (whatever it is) isn't a flag, it takes an
  303. argument.  Fixed this in amiga_main.c.  Thanks to Thomas Aglassinger
  304. <agi@rieska.oulu.fi> for spotting this bug.
  305.  
  306. ========================================================================
  307. v0.6 15 Jan 98
  308. ------------------------------------------------------------------------
  309. Applied patches to amiga_music.s as supplied by Joe Fenton.
  310. Also added code to set correct frequency for PAL or NTSC instead of
  311. assuming NTSC.
  312.  
  313. ------------------------------------------------------------------------
  314. Applied patches to column and span drawing routines in amiga_draw.s as
  315. supplied by Aki Laukkanen.  This fixed all the bright dots scattered
  316. around floors and ceilings, and the red stairs at the start.  Disabled
  317. various routines in r_draw.c, r_segs.c and r_things.c that are
  318. replaced by routines in amiga_draw.s.
  319.  
  320. ------------------------------------------------------------------------
  321. Now use FPU for FixedMul() on 68060.  Joe Fenton says "2 FP multiplies
  322. beat the hell out of 4 word multiplies, plus the associated adds and
  323. swaps".  Added SetFPMode() routine to amiga_fixed.s to set FPU
  324. rounding mode to "round towards minus infinity".  Otherwise WAD demos
  325. got out of step and went wrong when using FPU for multiply.
  326.  
  327. ------------------------------------------------------------------------
  328. In p_map.c, undid the patch I made in version 0.0 by changing line:
  329.  
  330.     if (ld->special && numspechit < MAXSPECIALCROSS)
  331.  
  332. back to:
  333.  
  334.     if (ld->special)
  335.  
  336. Instead added code in p_map.c and p_enemy.c to check bounds of all
  337. spechit[] array accesses.  With MAXSPECIALCROSS == 8, got lots of
  338. array out of bounds accesses, especially in 2nd level of DOOM II.
  339. Changed MAXSPECIALCROSS from 8 to 20.  That got rid of them.
  340.  
  341. ------------------------------------------------------------------------
  342. After several hours of stepping through with CPR, finally found and
  343. fixed the bug that made the Doom II "Dead Simple" level impossible to
  344. complete.  For the function pointer comparison in the line:
  345.  
  346.     if (th->function.acp1 != (actionf_p1)P_MobjThinker)
  347.  
  348. in p_enemy.c, SAS/C generated code which compared acp1 with the
  349. address of the ALV (JMP instruction) for P_MobjThinker() instead of
  350. the address of the P_MobjThinker() function itself.  Thus the test
  351. always failed, even when the function pointers were the same.  Fixed
  352. by compiling everything with ABSFUNCPOINTER.
  353.  
  354. I reported this to Steve Krueger at SAS.  He replied:
  355.  
  356. "It's not a bug, but rather a limitation of the CODE=NEAR model. We
  357. even document this in the manual, and provide an option to work around
  358. it if you still want to use CODE=NEAR. Check the manual for
  359. information on the ABSFUNCTIONPOINTER option.
  360.  
  361. ------------------------------------------------------------------------
  362. Found and fixed the crash on exit bug when music is enabled.  Register
  363. a0 wasn't initialised to _custom in FreeChannels() in amiga_music.s.
  364.  
  365. ------------------------------------------------------------------------
  366. Added -nosfx option and tooltype for disabling sound effects and
  367. leaving audio channels free.
  368.  
  369. ------------------------------------------------------------------------
  370. Added Aki Laukkanen's code to amiga_video.c for marking screens[0] and
  371. the video raster as "imprecise" with the MMU when the -mmu option is
  372. specified.  This should create a slight speedup for 68060.
  373.  
  374. ------------------------------------------------------------------------
  375. Started adding code for -directcgx option for rendering directly to
  376. framebuffer of any video card running CyberGraphX.  Discovered it
  377. flickers badly and needs double or triple-buffering.  Started adding
  378. code for double-buffering, but didn't get logic for interaction with
  379. I_ReadScreen() right.  Still haven't got LockBitMapTags() and
  380. UnLockBitMap() called from the right places, so sometimes tries to
  381. write to framebuffer (screens[0]) while not locked.  This may corrupt
  382. other screens if you flip or drag screens while running with
  383. -directcgx.
  384.  
  385. ------------------------------------------------------------------------
  386. Applied patches from Aki Laukkanen to get low detail mode working.
  387. This included substantial changes to amiga_draw.s and r_draw.c.  The
  388. assembly routines Aki supplied for R_DrawFuzzColumn(),
  389. R_DrawFuzzColumnLow(), R_DrawTranslatedColumn() and
  390. R_DrawTranslatedColumnLow() didn't appear to work right, so reverted
  391. to C versions in r_draw.c.
  392.  
  393. ========================================================================
  394. v0.5  8 Jan 98
  395. ------------------------------------------------------------------------
  396. Added music code in amiga_music.s based on Joseph Fenton .MUS player.
  397. Changed amiga_sound.s to use only 2 channels for sound effects when
  398. music is enabled, and 4 channels when music is disabled.  Added
  399. MIDI_Instruments and MIDI_Instruments.s to archive.  MIDI_Instruments.s
  400. isn't actually used, but it's helpful for understanding the instrument
  401. format.
  402.  
  403. ------------------------------------------------------------------------
  404. Added Aki Laukkanen's latest 68040 and 68060-optimised column and span
  405. renderers in amiga_draw.s.  Modified r_main.c and r_draw.h to handle
  406. different DrawColumn_040(), DrawColumn_060(), DrawSpan_040() and
  407. DrawSpan_060().  Aki sent me some more fast C2P and MMU routines but I
  408. haven't got those working yet.
  409.  
  410. ------------------------------------------------------------------------
  411. The call to BestModeID() in amiga_video.c had an unterminated taglist.
  412. Fixed.
  413.  
  414. ------------------------------------------------------------------------
  415. Added Aki's 68060 versions of FixedMul() and FixedDiv() in amiga_fixed.s.
  416. 68060 FixedDiv uses FPU.  If there is no FPU, fall back to 68040 version.
  417. Added code to select appropriate routines in amiga_main.c.
  418. Changed FixedMul() definitions in m_fixed.h to look like this:
  419. extern fixed_t (*FixedMul)    (fixed_t a, fixed_t b);
  420. extern fixed_t (*FixedDiv)    (fixed_t a, fixed_t b);
  421. fixed_t FixedMul_040    (fixed_t a, fixed_t b);
  422. fixed_t FixedMul_060    (fixed_t a, fixed_t b);
  423. fixed_t FixedDiv_040    (fixed_t a, fixed_t b);
  424. fixed_t FixedDiv_060fpu    (fixed_t a, fixed_t b);
  425. /* fixed_t FixedDiv2    (fixed_t a, fixed_t b); */
  426.  
  427. ------------------------------------------------------------------------
  428. Added code to amiga_video.c to check version numbers before trying to
  429. call BestModeID() and put up a screenmode requester.  Explicitly
  430. declared LowLevelBase so it doesn't try and autoopen lowlevel.library.
  431.  
  432. ------------------------------------------------------------------------
  433. Fixed I_WaitVBL() in amiga_video.c to call WaitTOF().  It's only
  434. called on exit to delay long enough to hear the final sound effect.
  435.  
  436. ========================================================================
  437. v0.4
  438. ------------------------------------------------------------------------
  439. Gamma correction wasn't working in ECS mode.  Fixed in I_Palette()
  440. in amiga_video.c.
  441.  
  442. ------------------------------------------------------------------------
  443. I think I finally found the cause of the 80000003 crash on exit.  It
  444. was caused by 2 missing commas in the initialisation strings for
  445. endmsg[] in dstrings.c following the strings: "go ahead and leave. see
  446. if i care." and "you're lucky i don't smack\nyou for thinking about
  447. leaving.".  Fixed.
  448.  
  449. ------------------------------------------------------------------------
  450. Added 68020/30 optimised C2P routine in c2p_020.s.  Use blitter for
  451. final passes which means double-buffering is required to eliminate
  452. otherwise severe flicker.  Implemented double-buffering for all planar
  453. modes in amiga_video.c.
  454.  
  455. ------------------------------------------------------------------------
  456. Found that the last QBlit() pass finished while the main program was
  457. in the middle of 3D rendering.  This meant the ChangeScreenBuffer()
  458. call was delayed until the end of rendering.  The program felt very
  459. sluggish, even though the frame-rate was higher than before because
  460. there was a much longer delay between pressing a key and seeing the
  461. result happen on the screen.  To solve this I created a new subtask
  462. which simply calls ChangeScreenBuffer() in a loop when signalled from
  463. the QBlit() cleanup function.  This way the main engine is interrupted
  464. to call ChangeScreenBuffer() at the earliest opportunity.  Extensive
  465. changes are in amiga_video.c.
  466.  
  467. ------------------------------------------------------------------------
  468. Gabry (ggreco@iol.it) emailed me some CD32 joypad handling code.  I
  469. included it in amiga_video.c (disabled by default) but I can't test
  470. it.  To enable it, use the -joypad option or JOYPAD tooltype.
  471.  
  472. ------------------------------------------------------------------------
  473. Several people sent me faster replacements for R_DrawColumn() and
  474. R_DrawSpan() in amiga_draw.s, but so far only one of them worked
  475. right.
  476.  
  477. ========================================================================
  478. v0.3
  479. ------------------------------------------------------------------------
  480. Low detail code doesn't work, so disabled detail level toggle in
  481. m_menu.c.  Previously setting low detail and then resizing screen
  482. corrupted graphics.
  483.  
  484. ------------------------------------------------------------------------
  485. Added ClearPointer() call before CloseWindow() in amiga_video.c.
  486. Let's see if that fixes the crash on exit.  Hmm, seems OK after about
  487. a dozen runs.  Perhaps it was a bug in CyberGraphX.  ... nope, just
  488. got another 80000003 crash on exit  :(
  489.  
  490. ------------------------------------------------------------------------
  491. Added code to get ProgramName in amiga_main.c.  Added definition of
  492. ProgramName in m_args.h and m_args.c.
  493.  
  494. ------------------------------------------------------------------------
  495. Allocated space for myargv[] in amiga_main.c and copy argv[] across.
  496. Parse icon tooltypes and convert to additional entries in myargv[]
  497. and myargc.
  498.  
  499. ------------------------------------------------------------------------
  500. Added -screenmode option to set ScreenMode in amiga_video.c
  501.  
  502. ------------------------------------------------------------------------
  503. Added -forcedemo option in g_game.c to force demos to play even if
  504. the version number doesn't match.
  505.  
  506. ------------------------------------------------------------------------
  507. Changed handling of $HOME in d_main.c to append a '/' if it doesn't
  508. already end in a '/' or a ':'.
  509.  
  510. ------------------------------------------------------------------------
  511. Added trailing slashes to definitions of DEVMAPS and DEVDATA in
  512. dstrings.h.
  513. #define DEVMAPS "devmaps/"
  514. #define DEVDATA "devdata/"
  515.  
  516. ========================================================================
  517. v0.2   1 Jan 1998
  518. ------------------------------------------------------------------------
  519. Changed zone management code to allocate between 2Mb and 6Mb instead
  520. of always 6Mb.  ADoom should now work on Amigas with less memory.
  521. Check result of allocation.  Previous version crashed if 6Mb malloc
  522. failed.
  523.  
  524. ------------------------------------------------------------------------
  525. Changed handling of HOME environment variable in d_main.c
  526.  
  527. ------------------------------------------------------------------------
  528. The Amiga doesn't have F11 and F12 keys.  Changed amiga_video.c to map
  529. the '[' and ']' keys to F11 and F12.  Now gamma correction works.
  530. Also fixed keypad '+'.
  531.  
  532. ------------------------------------------------------------------------
  533. Added joystick code using gameport device in amiga_video.c.  Changed
  534. m_misc.c to enable usejoystick.
  535.  
  536. ------------------------------------------------------------------------
  537. Added AmiTCP networking support by writing a new version of
  538. amiga_net.c based on i_net.c for Linux.  Successfully worked to a PC
  539. running Linux with DOOM compiled from the released DOOM sources.
  540. Performance was really bad, with lots of jerking, even on ethernet.
  541. Tried improving performance by making sends non-blocking as well as
  542. recvs.  AmiTCP 4.3 appears to return errno==EINVAL instead of
  543. errno=EWOULDBLOCK for non-blocking recvfrom() and non-blocking
  544. sendto() --- seems pretty weird to me, or have I done something wrong?
  545.  
  546. ========================================================================
  547. v0.1  30 Dec 97
  548. ------------------------------------------------------------------------
  549. Open audio.device on 4 channels and play sound effects in
  550. amiga_sound.c.  Cache up to 12 sound effects in chipmem at a time.
  551. All other sound effects are cached in fastmem.  Audio period is still
  552. not calculated correctly from pitch.  Separation (balance) is ignored,
  553. so 3D sound effects are not right.  Changed s_sound.c to pass channel
  554. number (cnum) to I_StartSound().  Changed m_misc.c to set 4 channels
  555. instead of 3.
  556.  
  557. ------------------------------------------------------------------------
  558. Deleted calls to I_UpdateSound() and I_SubmitSound() in d_main.c
  559.  
  560. ------------------------------------------------------------------------
  561. Stripped 68040-optimised AGA and ECS(EHB) C2P routines out of Flick
  562. v1.5 and linked them into amiga_video.c.  Changed "dirty_list"
  563. mechanism to a comparison buffer instead.  Added amiga_median.c for
  564. calculating best EHB palette and 8-bit -> 6-bit colour xlate table.
  565. Changed EHB C2P routine to handle colour translate table (probably not
  566. entirely efficiently).  These routines are not quite state-of-the-art
  567. (e.g, old merge macro) but they are not bad either.  Linked in 68020-
  568. and Akiko-optimised routines too, but they are not called yet.
  569.  
  570. ------------------------------------------------------------------------
  571. Made a minor optimisation speedup to R_DrawColumn().
  572.  
  573. ========================================================================
  574. v0.0  28 Dec 97
  575. ------------------------------------------------------------------------
  576. Wrote amiga_main.c, amiga_system, amiga_sound.c, amiga_video.c,
  577. amiga_net.c and smakefile to replace i_main.c, i_system, i_sound.c,
  578. i_video.c, i_net.c and Makefile respectively.  The amiga_sound and
  579. amiga_net routines are dummies.
  580.  
  581. ------------------------------------------------------------------------
  582. Amiga is big-endian.  Compiled with DEFINE=__BIG_ENDIAN__.  It looks
  583. like the code hasn't been tested with __BIG_ENDIAN__ for a while.  The
  584. test in m_swap.c for whether swap routines should be included was
  585. around the wrong way.  SwapSHORT() returned an int instead of an
  586. unsigned short.
  587.  
  588. ------------------------------------------------------------------------
  589. Fixed point arithmetic routines in m_fixed.c used (long long) 64-bit
  590. datatype not available in SAS/C.  Replaced with assembly routines in
  591. amiga_fixed.s.  Added check for divide by 0 in FixedDiv() because
  592. Amiga crashes on divide by 0.
  593.  
  594. ------------------------------------------------------------------------
  595. The Unix function alloca() was called from r_data.c, w_wad.c and some
  596. other files.  I replaced with calls to malloc() and added calls to
  597. free() where each routine returns.
  598.  
  599. ------------------------------------------------------------------------
  600. Changed the cache routines in w_wad.c to use the more efficient
  601. fopen(), fread(), fseek(), fclose() instead of open(), read(),
  602. lseek(), close().  Changed handles from (int) to (FILE *) everywhere
  603. including lumpinfo_t structure in w_wad.h.  Fixed the filelength()
  604. function to align stat structure on 4-byte boundary.  Used SAS/C
  605. fileno() function to get file number from (FILE *).
  606.  
  607. ------------------------------------------------------------------------
  608. In d_main.c, changed the handling of slashes and double-dots in
  609. filenames to Amiga conventions.
  610.  
  611. ------------------------------------------------------------------------
  612. Moved definition of RANGECHECK from doomdef.h to smakefile.  Disabled
  613. SNDSERV and SNDINTR in doomdef.h.
  614.  
  615. ------------------------------------------------------------------------
  616. SAS/C 6.58 appeared to generate bad code for the line:
  617.  
  618.     offsetangle = abs(rw_normalangle-rw_angle1);
  619.  
  620. in r_segs.c, resulting in corrupted graphics.  This took me hours to
  621. track down.  Putting printf() instructions before and after, the code
  622. calulated abs(1073741824-1927746431)=1073741824 instead of the correct
  623. answer of 854004607.  As far as I could see, it was using the stdlib.h
  624. definition of abs(), which looks fine.  As a workaround, I changed
  625. abs() to iabs() (SAS/C function) throughout in all sources.
  626.  
  627. On 5 Jan 98, Michael van Elst <mlelstv@serpens.swb.de> offered the
  628. following explanation:
  629.  
  630. >It doesn't. It is an artefact of ANSI C. rw_normalangle is defined
  631. >as unsigned, rw_angle1 is defined as int. The result of the difference
  632. >is therefore unsigned. You need something like:
  633. >
  634. >    offsetangle = abs((int)rw_normalangle - (int)rw_angle1);
  635. >or  offsetangle = abs((long)rw_normalangle - (long)rw_angle1);
  636. >
  637. >and make sure that rw_normalangle fits into the positive int or
  638. >long values.
  639. >[...]
  640. >gcc probably doesn't use the macro but an abs(int) function. You
  641. >get the same with SAS/C if you #undef abs.
  642.  
  643. ------------------------------------------------------------------------
  644. Got READ enforcer hits in p_enemy.c at the line:
  645.  
  646.         ld = spechit[numspechit];
  647.  
  648. Crashed badly shortly afterwards if Enforcer was not running.  As far
  649. as I can tell, the variable numspechit should be in the range 0..7.
  650. Somehow numspechit gets the value 149551680 (0x8e9fa40).  Without
  651. really knowing what I was doing, I attempted to fix the problem by
  652. changing the line:
  653.  
  654.     if (ld->special)
  655.  
  656. in p_map.c to:
  657.  
  658.     if (ld->special && numspechit < MAXSPECIALCROSS)
  659.  
  660. So far it seems to work.
  661.  
  662. ------------------------------------------------------------------------
  663. Disassembled R_DrawColumn() and R_DrawSpan() with OMD, created
  664. amiga_draw.s and hand-optimised a bit.
  665.  
  666. ------------------------------------------------------------------------
  667. Program still often crashes on exit   :(
  668.  
  669. ------------------------------------------------------------------------
  670.